HTML mode is highly customizable. You can modify its behavior in several ways. The picture above shows the default setting of the flags and variables you can change. Most of the flags and variables are discussed in other places in this manual, in the context where they are used.
JavaScriptColoring | if set, key words and comments in JavaScript will be colored. The way the HTML tags are colored is also changed, because the old way does not work well together with JavaScript. The default is 0, do not color JavaScript's key words. |
---|---|
browseInForeground | if set, when you send a file to the browser, the browser will be brought to the foreground. If you have lots of screen space and are just validating, uncheck this flag to leave the browser in the background and Alpha in the foreground. The default is 1, bring browser to foreground. |
elecLBrace | when set, the left braces, {, will be electric like in C mode. Set this if you are editing JavaScript. The default is 0, { is not electric. |
elecRBrace | when set, the right braces, }, will be electric like in C mode. Set this if you are editing JavaScript. The default is 0, } is not electric. |
lidtAreContainers | If set, <LI>, <DT> and <DD> have corresponding closing tags. If not set the optional closing tags are skipped. The default is 0, do not insert a closing tag. |
inclEventHandler | when set, the event handlers (onFocus onSelect etc.) will appear in the attribute dialog. The default is 0, no event handlers in attribute dialog. |
pIsContainer | If set, the <P> element has a corresponding closing tag. If not set it does not. The default is 1, it has a closing tag. |
promptNoisily | If you input element attributes from the status bar, Alpha will beep when asking for element attribute information there. The default is 1, do beep. The value of this flag is only used if useBigWindows is not set. |
useBigWindows | If set, element attributes will be asked about in a a dialog box with all attributes, otherwise they will be asked about in the status bar. The default is 1, use dialog boxes. |
useLowerCase | If not set, elements will be like <P>; if 1, like <p>. The default is 0, upper case. |
useTabMarks | If not set, will not insert the ![]() |
prefixString suffixString | The string to begin a comment, and the one to end a comment. Change these if you want to make comments in JavaScript, but do not forget to change them back when you want to make a HTML comment again. |
---|---|
JavaScriptColor | The color of keywords in JavaScript. These are only colored if the flag JavaScriptColoring is set. The default is magenta. |
stringColor | The color of everything between quotes. Only used if the flag JavaScriptColoring is set. The default is green. |
tagColor | The color of the HTML tags. The default is blue. |
wordBreak wordBreakPreface wrapBreak wrapBreakPreface | The first two control which characters build up words, and the other two control word wrapping. Read about them in the general manual if you want to change them (should usually not be needed). |
HTMLwords | keywords which you
want to be highlighted when editing HTML in Alpha. They are colored with
the same color as the HTML elements. If you want the words "cool" and
"nifty" to be highlighted, add the following to your preferences file:
lappend HTMLwords cool nifty htmlColorizingThe first line defines the words, and the second one tells Alpha to color them. The default is {}, i.e. no keywords. |
---|
It is possible to change the key bindings by using the Alpha "bind" command.
Here are some simple bindings, included as samples of what is possible. For example, if you don't use an American keyboard, you maybe want to change the bindings for < > and & to where they actually are on your keyboard. For example, to get it right on my Swedish keyboard I put the following lines in my preferences file.
bind '<' <o> {insertText "<\;"} HTML bind '<' <so> {insertText ">\;"} HTML bind '6' <so> {insertText "&\;"} HTML
Read more about how to define your own key bindings in the general manual.